Computer-process execution environments are multitask environments in which a plurality of processes is executed in parallel. In the multitask environment, a task switching process (task switch) wherein tasks to be executed are switched based on predetermined conditions performed by, for instance, an operating system (OS) by which the individual tasks are executed in sequence. In general, the task switching process is performed by executing an interrupt process involving a series of operations for switching tasks while the one is already running.
In the multitask environment, if a task is processed by a real-time process, the process needs to be guaranteed to be completed within a predetermined time. Processing time for a CPU instruction generally spans over several nanoseconds for logical operations, while for I/O instructions, it lasts typically several microseconds. Furthermore, if an I/O instruction is re-executed, the process is temporarily cancelled by the task switch, the state of a device and the like to be accessed changes before execution, causing problems. Accordingly, I/O instructions that are initiated to process a task cannot be interrupted.
Therefore, for a multitask control accompanying real-time processing, it is necessary to set the switching time and the longest processing time in order not to exceed the longest processing time (hereinafter referred to as the longest processing time) allocated for executing each task. This will ensure a real-time performance even if an I/O instruction that requires a long processing time executed immediately before the time allocated to the task (hereinafter referred to as a switching time) runs out.
In a multitask control accompanying real-time processing, the switching time and the longest processing time are set so as not to exceed the longest processing time even if an I/O instruction executed immediately before the switching time runs out. However, decreasing the task switching time increases the proportion of the time for spare the longest processing time (hereinafter referred to as the float). This increases the number of times of task switches, resulting in a decrease in the processing efficiency of the entire system. However, it can be difficult to estimate the longest processing time necessary for obtaining sufficient float, making it impossible to set the longest processing time and the switching time.